package control;

import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;

/**
 * 全局的键盘监听器
 * 用于监听功能键,主要是ctrl
 * 
 * @author raymondwong
 *
 */
public class KeyboardControl extends KeyAdapter {

  private AmControl amControl = null;
  
  public KeyboardControl(AmControl amControl) {
    this.amControl = amControl;
  }
  
  /**
   * 键盘按下事件
   */
  @Override
  public void keyPressed(KeyEvent e) {
    this.amControl.actionByKeyCode(e.getKeyCode());
  }

}